﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Entity
{
    [Table("wms_knzy_inventory_details")]
    public class InventoryDetailsEntity
    {
        [Key]
        public int inventory_detail_id { get; set; }
        public int inventory_list_id { get; set; }

        [MaxLength(50)]
        public string product_code { get; set; }
        public string product_name { get; set; } // 新增产品名称属性
        public decimal book_inventory { get; set; } // 账面库存
        public decimal book_amount { get; set; } // 账面金额

        [MaxLength(100)]
        public string inventory_location { get; set; } // 盘点位置

        public decimal stkt_num { get; set; } // 实际盘点数量（原stocktake_number）
        public decimal pl_num { get; set; } // 盈亏数量（原profit_loss_number）
        public decimal reference_unit_price { get; set; } // 参考单价
        public decimal profit_and_loss_amount { get; set; } // 盈亏金额

        [MaxLength(200)]
        public string note { get; set; }
        // 关键：添加 inventory_status 属性（与 SQL 参数 @inventory_status 匹配）
        public int inventory_status { get; set; } = 0; // 设默认值，避免 NULL

        [MaxLength(50)]
        public string create_by { get; set; }
        public DateTime create_time { get; set; }

        [MaxLength(50)]
        public string update_by { get; set; }
        public DateTime? update_time { get; set; }

        public string is_delete { get; set; }
       
    }
    public class FrontInventoryDetail
    {
        public string product_code { get; set; }
        public int? book_quantity { get; set; }   // 对应实体类 `book_inventory`
        public decimal? book_amount { get; set; }
        public string check_location { get; set; } // 对应实体类 `inventory_location`
        public decimal? reference_price { get; set; } // 对应实体类 `reference_unit_price`
        public int? check_quantity { get; set; }  // 对应实体类 `stkt_num`
        public int? profit_loss_num { get; set; } // 对应实体类 `pl_num`
        public decimal? profit_loss_amount { get; set; } // 对应实体类 `profit_and_loss_amount`
        public string remark { get; set; }        // 对应实体类 `note`
    }
}